import typescript from 'rollup-plugin-typescript2'
import babel from 'rollup-plugin-babel'
import postcss from 'rollup-plugin-postcss'
import simplevars from 'postcss-simple-vars'
import nested from 'postcss-nested'
import postcssPresetEnv from 'postcss-preset-env'
export default {
    // 入口文件
    input: './src/index.tsx',
    output: {
        dir: './lib',
        format: 'cjs'
    },
    plugins: [
        typescript(),   // 会自动读取 tsconfig.json 
        babel(),         // 支持 babel
        postcss({
            plugins:[
                simplevars(),
                nested(),   // 处理less嵌套语法，貌似不生效 = = 
                postcssPresetEnv()
            ],
            extensions: ['.css', '.less']
        })
    ]
}